package com;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;

/**
 * InputStreamReader : 转换流,把字节 输入流转换为字符输出流
 * 
 * OutputStreamWriter : 字节输出转 字符输出
 * 
 * @author lenovo 2020年7月21日
 */
public class IO_11_BufferedReader_02 {

	public static void main(String[] args) {
		try (FileInputStream fis = new FileInputStream("./src/ip.txt");
				InputStreamReader isr = new InputStreamReader(fis);
				BufferedReader br = new BufferedReader(isr);) {
//			String tmp = null;
//			while ((tmp = br.readLine()) != null) {
//				System.out.println(tmp);
//			}
			char[] chars = new char[1024 * 1024 * 30 / 2];
			int tmp = 0;

			long startTime = System.currentTimeMillis();
			br.read(chars);

			long endTime = System.currentTimeMillis();
			System.out.println(endTime - startTime);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
